04. Scalar Multiplication of Matrix and Quiz
Scalar Multiplication of Matrix
To multiply a matrix by a scalar, we do not need to verify
- Dimensions
or - Indices
Simply multiply each element in the matrix by the scalar!
For example:
\alpha A=\begin{bmatrix} \alpha a_{11} &\alpha a_{12} &\alpha a_{13}&..& \alpha a_{1n}\\ \alpha a_{21} &\alpha a_{22} &\alpha a_{23}&..&\alpha a_{2n}\\\alpha a_{31} &\alpha a_{32} &\alpha a_{33}&..&\alpha a_{3n}\\ :\\\alpha a_{m1} &\alpha a_{m2} &\alpha a_{m3}&……&\alpha a_{mn}\end{bmatrix}
Equation 13
Quiz
What is the value of the {ij}th element of Matrix D if:
D=0.2A+(-5)B-2C
a. i=1, j=1
b. i=2, j=4
A=\begin{bmatrix} 3 &0.6 &4&-3\\ -1.3 &4 &0&8.6\\7&0 &-8& 0.006\end{bmatrix}
B=\begin{bmatrix} 3 &-5.76 &45&0\\ 2 &-2 &1.3&9\\-9&0 &0& 1\end{bmatrix}
C=\begin{bmatrix} 0 &1009 &-66.7849&90\\ 0 &5 &4&-0.07\\0&0 &0& 0\end{bmatrix}
Code
If you need a code on the https://github.com/udacity.
Notice that the equation: D=0.2A+(-5)B-2C represents a linear combination of matrices and scalars.